package tue.cse.advanceddatabases.project.db;

import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

public class JPAResourceBean {
    protected EntityManagerFactory emf;

    /*
     * Lazily acquire the EntityManagerFactory and cache it.
     */
     public EntityManagerFactory getEMF (){
        if (emf == null){
            emf = Persistence.createEntityManagerFactory("ad-db", new java.util.HashMap());
        }
        return emf;
    }
}
